﻿package com.vicentediaz.view.menu
{
    import flash.display.*;
    import flash.events.*;

    public class ToolButtons extends MovieClip
    {
        private var d3Button:UtilButton3D;
        private var brushButton:UtilButtonBrush;
        private static var _3D:Boolean = true;
        private static var _brush:Boolean = false;

        public function ToolButtons()
        {
            this.brushButton = new UtilButtonBrush();
            this.d3Button = new UtilButton3D();
            addChild(this.brushButton);
            addChild(this.d3Button);
            this.d3Button.x = this.brushButton.width + 2;
            this.brushButton.buttonMode = true;
            this.d3Button.buttonMode = true;
            this.brushButton.addEventListener(MouseEvent.CLICK, this.onIconBrushClick, false, 0, true);
            this.d3Button.addEventListener(MouseEvent.CLICK, this.onIcon3DClick, false, 0, true);
            this.brushButton.fadeIcon(0.3);
            return;
        }// end function

        private function onIconBrushClick(param1:MouseEvent) : void
        {
            _brush = !_brush;
            this.brushButton.fadeIcon(_brush ? (1) : (0.3));
            return;
        }// end function

        private function onIcon3DClick(param1:MouseEvent) : void
        {
            _3D = !_3D;
            this.d3Button.fadeIcon(_3D ? (1) : (0.3));
            return;
        }// end function

        public static function get enabled3D() : Boolean
        {
            return _3D;
        }// end function

        public static function get enabledBrush() : Boolean
        {
            return _brush;
        }// end function

    }
}
